import { addSeconds } from "./addSeconds"

export function addMinute(num: string | number, date: Date = new Date()) {
  num = Number(num)
  if (num > parseInt(num as any)) {
    return addSeconds(num * 60, date)
  }
  date.setMinutes(date.getMinutes() + num)
  return date
}